Type PlaylistCollection

	Field currentLink:TLink
	Field list:TList
	
	Method New()
		currentLink = Null
		list        = New TList
	End Method

	Method AddFirst:Playlist(t:Playlist)
		list.AddFirst(Object(t))
		Return t
	End Method

	Method AddLast:Playlist(t:Playlist)
		list.AddLast(Object(t))
		Return t
	End Method

	Method Clear()
		currentLink = Null
		list.Clear()
	End Method

	Method Contains:Int(t:Playlist)
		Return list.Contains(Object(t))
	End Method

	Method Count:Int()
		Return list.Count()
	End Method

	Method First:Playlist()
		Return Playlist(list.First())
	End Method

	Method IsEmpty:Int()
		Return list.IsEmpty()
	End Method

	Method Last:Playlist()
		Return Playlist(list.Last())
	End Method

	Method Remove(t:Playlist)
		list.Remove(Object(t))
	End Method

	Method Reverse()
		list.Reverse()
	End Method
	
	Method Rewind()
		currentLink = list.FirstLink()
	End Method

	Method Current:Playlist()
		If Valid() = False Then
			Return Null
		End If
		Return Playlist(currentLink.Value())
	End Method

	Method MoveNext()
		If Valid() Then
			currentLink = currentLink.NextLink()
		End If
	End Method

	Method Valid:Int()
		If currentLink = Null Then
			Return False
		End If
		Return True
	End Method

End Type
